home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / ACORNUSERS / CBSA / EDUCATION / LOADER / h / WimpIcon < prev    next >
Text File  |  1997-12-07  |  3KB  |  128 lines

  1.  
  2. //-----------------------------------
  3. //             WimpIcon.h
  4. //-----------------------------------
  5.  
  6.  
  7. #ifndef WimpIcon_H
  8. #define WimpIcon_H
  9.      
  10. enum buttontype {                /* button types */
  11.      BIGNORE,               /* ignore all mouse ops */
  12.      BNOTIFY,
  13.      BCLICKAUTO,
  14.      BCLICKDEBOUNCE,
  15.      BSELREL,
  16.      BSELDOUBLE,
  17.      BDEBOUNCEDRAG,
  18.      BRELEASEDRAG,
  19.      BDOUBLEDRAG,
  20.      BSELNOTIFY,
  21.      BCLICKDRAGDOUBLE,
  22.      BCLICKSEL,              /* useful for on/off and radio buttons */
  23.      BWRITABLE = 15
  24.      } ;
  25.  
  26.           
  27. class WimpIcon
  28. {
  29.   friend class MenuItem;
  30.   friend class WimpMenu;
  31.   friend class WimpWindow;
  32.   
  33.   public:
  34.   
  35.   enum Flags {                  /* icon flag set */
  36.      ITEXT      = 0x00000001,     /* icon contains text */
  37.      ISPRITE    = 0x00000002,     /* icon is a sprite */
  38.      IBORDER    = 0x00000004,     /* icon has a border */
  39.      IHCENTRE   = 0x00000008,     /* text is horizontally centred */
  40.      IVCENTRE   = 0x00000010,     /* text is vertically centred */
  41.      IFILLED    = 0x00000020,     /* icon has a filled background */
  42.      IFONT      = 0x00000040,     /* text is an anti-aliased font */
  43.      IREDRAW    = 0x00000080,     /* redraw needs application's help */
  44.      INDIRECT   = 0x00000100,     /* icon data is 'indirected' */
  45.      IRJUST     = 0x00000200,     /* text right justified in box */
  46.      IESG_NOC   = 0x00000400,     /* if selected by right button, don't
  47.                                    * cancel other icons in same ESG */
  48.      IHALVESPRITE=0x00000800,     /* plot sprites half-size */
  49.      IBTYPE     = 0x00001000,     /* 4-bit field: button type */
  50.      ISELECTED  = 0x00200000,     /* icon selected by user (inverted) */
  51.      INOSELECT  = 0x00400000,     /* icon cannot be selected (shaded) */
  52.      IDELETED   = 0x00800000,     /* icon has been deleted */
  53.      IFORECOL   = 0x01000000,     /* 4-bit field: foreground colour */
  54.      IBACKCOL   = 0x10000000      /* 4-bit field: background colour */
  55.      } ;
  56.        
  57.   private:
  58.   
  59.   int window_handle;
  60.   int handle;
  61.   int xmin;
  62.   int ymin;
  63.   int xmax;
  64.   int ymax;
  65.   int flags;
  66.   union
  67.   {
  68.     char text[12];
  69.     char sprite_name[12];
  70.     struct
  71.     {
  72.       char *text;
  73.       char *filter;
  74.       int text_lenght;
  75.     } indirect_text;
  76.     struct
  77.     {
  78.       union
  79.       {
  80.       int *sprite;
  81.       char *sprite_name;
  82.       };
  83.       int *sprite_area;
  84.       int isname;
  85.     }indirect_sprite;
  86.     struct
  87.     {
  88.       char *text;
  89.       char *filter;
  90.       int text_lenght;
  91.     }indirect;
  92.   };
  93.   
  94.   public:
  95.   
  96.   enum Direction
  97.    {
  98.    UP,
  99.    DOWN,
  100.    LEFT,
  101.    RIGHT
  102.    } ;
  103.   
  104.   WimpIcon(WimpIcon &, 
  105.            int = ISPRITE + INDIRECT + IHCENTRE + IBTYPE*BCLICKDEBOUNCE,
  106.            int = -1, int = 0,
  107.            int = 0, int = 0, int = 70, int = 76);
  108.   WimpIcon(char *, 
  109.            int = ISPRITE + IHCENTRE + IBTYPE*BCLICKDEBOUNCE,
  110.            int = -1, int = 0,
  111.            int = 0, int = 0, int = 70, int = 76);  
  112.            
  113. /*  WimpIcon(Sprite &, 
  114.            int = ISPRITE + INDIRECT + IHCENTRE + IBTYPE*BCLICKDEBOUNCE,
  115.            int = -1, int = 0
  116.            int = 0, int = 0, int = 70, int = 76);           
  117.   WimpIcon(WimpWindow &, int);   */
  118.                    
  119.   ~WimpIcon();
  120.   
  121.   void Delete();
  122. };
  123.  
  124. #endif
  125.  
  126.  
  127.  
  128.